home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / cxref-1.001 / cxref-1~ / cxref / README.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-13  |  2.5 KB  |  120 lines

  1. /*****************
  2.   $Header: /home/amb/cxref/RCS/README.c 1.2 1995/07/30 17:16:07 amb Exp $
  3.  
  4.   A comment for the file, RCS header comments are treated specially when first.
  5.   *****************/
  6.  
  7.  
  8.  
  9. /*+ A #include comment +*/
  10. #include <stdio.h>
  11.  
  12.  
  13. #include <math.h>  /*+ An alternative #include comment. +*/
  14.  
  15. /* Note: The above comment is ignored without cxref-cpp, see README. */
  16.  
  17.  
  18.  
  19. /*+ A #define comment. +*/
  20. #define def1 1
  21.  
  22.  
  23. #define def2 2  /*+ An alternative #define comment. +*/
  24.  
  25. /* Note: The above comment is ignored without cxref-cpp, see README. */
  26.  
  27. /*+++++++++++
  28.   A #define with args
  29.  
  30.   arg1 The first arg
  31.  
  32.   arg2 The second arg
  33.   +++++++++++*/
  34.  
  35. #define def3(arg1,arg2) (arg1+arg2)
  36.  
  37.  
  38. /*+ An alternative #define with args. +*/
  39.  
  40. #define def4(arg1 /*+The first arg+*/,  \
  41.              arg2 /*+The second arg+*/) \
  42.            (arg1+arg2)
  43.  
  44. /* Note: the above works with cxref-cpp only, see README. */
  45.  
  46.  
  47.  
  48. /*+ An example typedef comment +*/
  49. typedef enum
  50. {
  51.  one,            /*+ one value +*/
  52.  two             /*+ another value +*/
  53. }
  54. type1;
  55.  
  56.  
  57. /*+ Another example typedef comment, +*/
  58. typedef struct
  59. {
  60.  int a;         /*+ A variable in a struct. +*/
  61.  union bar
  62.   {
  63.    void a;      /*+ Each element +*/
  64.    int  b,      /*+ of a struct +*/
  65.         c;      /*+ or a union +*/
  66.    long d;      /*+ can have a comment +*/
  67.   }
  68.  e;             /*+ Nested structs and unions also work. +*/
  69. }
  70. type2,          /*+ a type that is a struct. +*/
  71. *ptype2;        /*+ a pointer to a struct type. +*/
  72.  
  73.  
  74.  
  75. /*+ A leading comment only. +*/
  76. int var1,var2;
  77.  
  78.  
  79. int var3; /*+ A trailing comment only. +*/
  80.  
  81.  
  82. /*+ A variable for +*/
  83. int var4,    /*+ one thing. +*/
  84.     var5,    /*+ a second thing. +*/
  85.     var6;    /*+ a third thing. +*/
  86.  
  87. /* Note: The leading comment is combined with each of the trailing comments. */
  88. /* Note: the push through of the comment above on the ',' and ';', see README. */
  89.  
  90.  
  91.  
  92. /*+++++++++++
  93.   A function comment (the comments for the args need to be separated by a blank line).
  94.  
  95.   int function1 The return value.
  96.  
  97.   int arg1 The first argument.
  98.  
  99.   int arg2 The second argument.
  100.  
  101.   Some more comment
  102.   +++++++++++*/
  103.  
  104. int function1(int arg1,int arg2)
  105. {
  106.  /*+ An internal comment in a function that appears as a
  107.    new paragraph at the end of the comment. +*/
  108. }
  109.  
  110.  
  111. /*+ An alternative function comment +*/
  112.  
  113. int function2(int arg1,  /*+ The first argument.  +*/
  114.               int arg2)  /*+ The second argument. +*/
  115. /*+ Returns a value +*/
  116. {
  117. }
  118.  
  119. /* Note: the push through of the comment above on the ',' and ')', see README. */
  120.